<%@ page language="java" contentType="text/html;charset=UTF-8" %>
<%@ include file="/static/include/taglib.jsp" %>
<!DOCTYPE html >
<html>
<head>
    <meta name="viewport" content="width=device-width"/>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <title>后台管理--机构列表</title>
    <link href="${ctxStatic}/layui/css/layui.css" rel="stylesheet"/>
    <link href="${ctxStatic}/css/kpiuitanchu.css" rel="stylesheet"/>
    <script src="${ctxStatic}/js/jquery-1.8.3.min.js?v=2.0" type="text/javascript"></script>
    <script src="${ctxStatic}/layui/layui.all.js" type="text/javascript"></script>
    <script src="${ctxStatic}/js/common.js" type="text/javascript"></script>
    <style>
        .td_right {
            text-align: right;
            min-width: 70px
        }

        .td_rightmy {
            width: 20%;
            text-align: right
        }

        .td_left {
            width: 30%;
            text-align: left;
        }

        .divtable {
        }

        .divtable .tablep {
            border: 1px solid #c2c2c2;
            border-collapse: collapse;
        }

        .divtable .tablep td {
            height: 40px;
            border: 1px solid #c2c2c2;
            color: #ffffff
        }

        .divsub {
            width: 100%
        }

        .divsub table {
            width: 100%;
            border: 0;
        }

        .divsub table td {
            height: 20px;
            border-right: 1px solid #c2c2c2;
            color: #ffffff
        }

        .divsub table th {
            height: 60px;
            border-right: 1px solid #c2c2c2;
            text-align: center
        }

        .textinput {
            height: 38px;
            width: 95%;
            border: 0;
            padding-left: 10px;
            outline: none;
            border: 0;
            color: #ffffff;
            background: #2A68A6
        }

        .layui-textarea {
            margin-top: 0;
            background: transparent;
            resize: none;
            border: 0
        }

        .textinput {
            background: transparent;
        }
    </style>
</head>
<body>

<form class="layui-form" id="formedit" name="formedit"
      action="add_useruatmzpd" method="post"
      target="d41d8cd98f00b204e9800998ecf8427e">
    <iframe name="d41d8cd98f00b204e9800998ecf8427e" src="about:blank"
            style="display: none;"></iframe>

    <div style="width:95%;margin:0 auto;text-align: center;padding:10px 0;font-size:16px;font-weight: bold;color:#ffffff">
        北京市公安局公务员平时考核（党员民主评议）登记表
    </div>

    <div style="width:95%;margin:0 auto;overflow-y:auto " class="divtable" id="divtable">
        <table style="width:100%" class="tablep">
            <tr>
                <td class="td_rightmy">姓名：</td>
                <td class="td_left">
                    <input type="text" name="realname" id="realname" class="textinput" readonly="readonly"
                           value="${entity.realname}"/>
                </td>
                <td class="td_rightmy">政治面貌：</td>
                <td class="td_left">
                    <input type="text" name="zzmm" id="zzmm" class="textinput" readonly="readonly"
                           value="${entity.zzmm}"/>
                </td>
            </tr>
            <tr>
                <td class="td_rightmy">工作单位职务：</td>
                <td class="td_left" colspan="3">
                    <input type="text" name="gzdw" id="gzdw" class="textinput" readonly="readonly"
                           value="${entity.gzdw}" style="width:50%;float:left"/>
                    <input type="text" name="zw" id="zw" class="textinput" readonly="readonly" value="${entity.zw}"
                           style="width:46.5%;float:left"/>
                </td>
            </tr>
            <tr>
                <td class="td_rightmy">从事工作：</td>
                <td class="td_left">
                    <input type="text" name="csgz" id="csgz" class="textinput" readonly="readonly"
                           value="${entity.csgz}"/>
                </td>
                <td class="td_rightmy">考核周期：</td>
                <td class="td_left">
                    <input type="text" name="khzq" id="khzq" class="textinput" readonly="readonly"
                           value="${entity.khzq}"/>
                </td>
            </tr>
            <tr>
                <td class="td_rightmy" style="height:80px">工作业绩：</td>
                <td class="td_left" colspan="3">
                    <textarea class="layui-textarea" name="gzyj">${entity.gzyj}</textarea>
                </td>
            </tr>
            <tr>
                <td class="td_rightmy" style="height:80px">存在不足：</td>
                <td class="td_left" colspan="3">
                    <textarea class="layui-textarea" name="czbz">${entity.czbz}</textarea>
                </td>
            </tr>
            <tr>
                <td class="td_rightmy">自评结果：</td>
                <td class="td_left" colspan="3">
                    <input type="hidden" id="hidzpjg" value="${entity.zpjg}">


                    <input type="radio" name="zpjg" value="好" title="好" checked="checked">
                    <input type="radio" name="zpjg" value="合格" title="合格">
                    <input type="radio" name="zpjg" value="差" title="差">


                </td>
            </tr>
            <tr>
                <td class="td_rightmy" style="height:80px">考勤情况：</td>
                <td class="td_left" colspan="3" style="padding: 0;margin: 0;vertical-align: top">
                    <div class="divsub">
                        <table>
                            <thead>
                            <tr>
                                <th>出勤<br/>天数</th>
                                <th>加班<br/>天数</th>
                                <th>休假<br/>天数</th>
                                <th>病事假<br/>天数</th>
                                <th>工伤、孕产<br/>假天数</th>
                                <th>迟到<br/>次数</th>
                                <th>早退<br/>次数</th>
                                <th style="border:0">旷工<br/>次数</th>
                            </tr>
                            </thead>

                            <tbody>
                            <tr>
                                <td style="border-bottom:0;border-left:0">
                                    <input type="text" name="kqcqts" id="kqcqts" class="textinput" style="width:86%"
                                           readonly="readonly" value="${entity.kqcqts}"/>
                                </td>
                                <td style="border-bottom:0">
                                    <input type="text" name="kqjbts" id="kqjbts" class="textinput" style="width:86%"
                                           readonly="readonly" value="${entity.kqjbts}"/>
                                </td>
                                <td style="border-bottom:0">
                                    <input type="text" name="kqxjts" id="kqxjts" class="textinput" style="width:86%"
                                           readonly="readonly" value="${entity.kqxjts}"/>
                                </td>
                                <td style="border-bottom:0">
                                    <input type="text" name="kqbsjts" id="kqbsjts" class="textinput" style="width:86%"
                                           readonly="readonly" value="${entity.kqbsjts}"/>
                                </td>
                                <td style="border-bottom:0">
                                    <input type="text" name="kqgsycjts" id="kqgsycjts" class="textinput"
                                           style="width:86%" readonly="readonly" value="${entity.kqgsycjts}"/>
                                </td>
                                <td style="border-bottom:0">
                                    <input type="text" name="kqcdcc" id="kqcdcc" class="textinput" style="width:86%"
                                           readonly="readonly" value="${entity.kqcdcc}"/>
                                </td>
                                <td style="border-bottom:0">
                                    <input type="text" name="kqztcc" id="kqztcc" class="textinput" style="width:86%"
                                           readonly="readonly" value="${entity.kqztcc}"/>
                                </td>
                                <td style="border-bottom:0">
                                    <input type="text" name="kqkgcc" id="kqkgcc" class="textinput" style="width:86%"
                                           readonly="readonly" value="${entity.kqkgcc}"/>
                                </td>
                            </tr>
                            </tbody>

                        </table>
                    </div>
                </td>
            </tr>

            <tr>
                <td class="td_rightmy">内部互评分(${entity.hpqz}%权重)：</td>
                <td class="td_left">
                    <input type="text" name="nbhpdf" id="nbhpdf" class="textinput" onchange="changeVal(this,1)"
                           value="${entity.nbhpdf}"/>
                    <input type="hidden" name="hpqz" value="${entity.hpqz}">
                </td>
                <td class="td_rightmy">领导评鉴得分(${entity.ldqz}%权重)：</td>
                <td class="td_left">
                    <input type="text" name="ldpjdf" id="ldpjdf" class="textinput" onchange="changeVal(this,2)"
                           value="${entity.ldpjdf}"/>
                    <input type="hidden" name="ldqz" value="${entity.ldqz}">
                </td>
            </tr>
            <tr>
                <td class="td_rightmy" style="height:80px">领导评议内容：</td>
                <td class="td_left" colspan="3">
                    <textarea class="layui-textarea" name="ldpynr" readonly="readonly">${entity.ldpynr }</textarea>
                </td>
            </tr>
            <tr>
                <td class="td_rightmy">平时考核综合得分：</td>
                <td class="td_left" colspan="3">
                    <input type="text" name="pskhzhdf" id="pskhzhdf" lay-verify="pskhzhdf" class="textinput"
                           style="width:98.3%" readonly="readonly" value="${entity.pskhzhdf}"/>
                </td>
            </tr>
            <tr>
                <td class="td_rightmy">组织评定结果：</td>
                <td class="td_left" colspan="3" style="padding-left:20px">
                    <input type="radio" name="zzpdjg" lay-filter="zzpdjg" value="好" title="好" checked="checked">
                    <span style="margin-left:14px"><input type="radio" lay-filter="zzpdjg" name="zzpdjg" value="合格"
                                                          title="合格"></span>
                    <input type="radio" name="zzpdjg" lay-filter="zzpdjg" value="差" title="差">
                    <span style="margin-left:42px"><input type="radio" name="zzpdjg" lay-filter="zzpdjg" value="不定结果"
                                                          title="不定结果"></span>
                </td>
            </tr>
            <tr>
                <td class="td_rightmy">党员民主评议结果：</td>
                <td class="td_left" colspan="3" style="padding-left:20px">
                    <input type="radio" name="dymzpyjg" value="优秀" title="优秀" checked="checked">
                    <input type="radio" name="dymzpyjg" value="合格" title="合格">
                    <input type="radio" name="dymzpyjg" value="基本合格" title="基本合格">
                    <input type="radio" name="dymzpyjg" value="不合格" title="不合格">
                    <input type="radio" name="dymzpyjg" value="不定等次" title="不定等次">
                </td>
            </tr>
            <tr>
                <td class="td_rightmy">本人签名：</td>
                <td class="td_left"></td>
                <td class="td_rightmy">日期：</td>
                <td class="td_left"></td>
            </tr>

        </table>

        <div style="width:100%;height:200px;margin-top:10px">
            <iframe src="../common/user_vtdp?userid=${entity.userid}&year=${entity.year}&quarter=${entity.quarter}"
                    width="100%" height="100%" style="display: block;border:0;padding:0;margin:0;" frameborder="no"
                    border="0" marginwidth="0" marginheight="0" scrolling="no" allowtransparency="yes"></iframe>
        </div>

    </div>

    <div style="width:90%;text-align: right;margin-top:15px;margin-right:100px">
        <button class="button"  lay-filter="demo1" id="btnsave">保存</button>
        <input type="button" class="button" value="关闭" onclick="top.CloseOpenWindow()"/>
    </div>

    <input type="hidden" value="${entity.userid }" name="userid">
    <input type="hidden" value="${entity.year }" name="year">
    <input type="hidden" value="${entity.quarter }" name="quarter">
    <input type="hidden" value="${error }" name="error" id="error">
    <input type="hidden" value="${mzpdid }" name="mzpdid" id="mzpdid">

</form>
<input type="hidden" value="${entity.dymzpyjg}" id="hiddymzpyjg">
<input type="hidden" value="${entity.zzpdjg}" id="hidzzpdjg">
<input type="hidden" value="${entity.zzmm}" id="hidzzmm">

<script>

    $(function () {
        $('#zpjg').val()


    })

    function changeVal(obj, type) {

        var value = $(obj).val();


           if(isNaN(value)){
               top.mylayui.msg('只能输入数字', {icon: 0});

               $(obj).val('');
               return;

           }
        if (type == 1) {
            if (value > 40) {
                top.mylayui.msg('分数最大不能超过40', {icon: 0});

                $(obj).val('')
            }


        }

        if (type == 2) {
            if (value > 60) {
                top.mylayui.msg('分数最大不能超过60', {icon: 0});


                $(obj).val('')
            }


        }

    }

    $('#btnsave').on('click', function () {


        $('#btnsave').attr("disabled", "disabled");
        $('#formedit').submit();

    })

    layui.use('form', function () {
        var form = layui.form; //只有执行了这一步，部分表单元素才会自动修饰成功


        form.verify({
            pskhzhdf: function (value, demo) {
                var jg = $(":radio[name='zzpdjg']:checked").val();
                if (jg == '差') {
                    if (Number(value) > 60) {
                        return '结果为差，综合评分不能高于60';
                    }
                }

            }
        })

        if ($("#mzpdid").val() != "0") {
            var zzmm = $("#hidzzmm").val();
            $(":radio[name='dymzpyjg']").removeAttr("checked", "checked");
            if (zzmm == '中共党员' || zzmm == '中共预备党员') {
                $(":radio[name='dymzpyjg'][value='" + $("#hiddymzpyjg").val() + "']").attr("checked", "checked");
            }
            else {
                $(":radio[name='dymzpyjg'][value='不定等次']").attr("disabled", "disabled");
                $(":radio[name='dymzpyjg'][value='优秀']").attr("disabled", "disabled");
                $(":radio[name='dymzpyjg'][value='基本合格']").attr("disabled", "disabled");
                $(":radio[name='dymzpyjg'][value='不合格']").attr("disabled", "disabled");
                $(":radio[name='dymzpyjg'][value='合格']").attr("disabled", "disabled");
            }


            $(":radio[name='zzpdjg']").removeAttr("checked", "checked");
            $(":radio[name='zzpdjg'][value='" + $("#hidzzpdjg").val() + "']").attr("checked", "checked");
        }
        else {
            var zzmm = $("#hidzzmm").val();
            $(":radio[name='dymzpyjg']").removeAttr("checked", "checked").removeAttr("disabled");
            if (zzmm == '中共党员') {
                $(":radio[name='dymzpyjg'][value='优秀']").attr("checked", "checked");
                $(":radio[name='dymzpyjg'][value='基本合格']").attr("disabled", "disabled");
                $(":radio[name='dymzpyjg'][value='不合格']").attr("disabled", "disabled");
                $(":radio[name='dymzpyjg'][value='不定等次']").attr("disabled", "disabled");
            }
            else if (zzmm == '中共预备党员') {
                $(":radio[name='dymzpyjg'][value='不定等次']").attr("checked", "checked");
                $(":radio[name='dymzpyjg'][value='优秀']").attr("disabled", "disabled");
                $(":radio[name='dymzpyjg'][value='基本合格']").attr("disabled", "disabled");
                $(":radio[name='dymzpyjg'][value='不合格']").attr("disabled", "disabled");
                $(":radio[name='dymzpyjg'][value='合格']").attr("disabled", "disabled");
            }
            else {
                $(":radio[name='dymzpyjg'][value='不定等次']").attr("disabled", "disabled");
                $(":radio[name='dymzpyjg'][value='优秀']").attr("disabled", "disabled");
                $(":radio[name='dymzpyjg'][value='基本合格']").attr("disabled", "disabled");
                $(":radio[name='dymzpyjg'][value='不合格']").attr("disabled", "disabled");
                $(":radio[name='dymzpyjg'][value='合格']").attr("disabled", "disabled");
            }
        }


        form.on('radio(zzpdjg)', function (data) {
            var zzmm = $("#hidzzmm").val();
            //var zzmm='中共预备党员';
            switch (data.value) {
                case "好":
                    $(":radio[name='dymzpyjg']").removeAttr("checked", "checked").removeAttr("disabled");
                    if (zzmm == '中共党员') {
                        $(":radio[name='dymzpyjg'][value='优秀']").attr("checked", "checked");
                        $(":radio[name='dymzpyjg'][value='基本合格']").attr("disabled", "disabled");
                        $(":radio[name='dymzpyjg'][value='不合格']").attr("disabled", "disabled");
                        $(":radio[name='dymzpyjg'][value='不定等次']").attr("disabled", "disabled");
                    }
                    else if (zzmm == '中共预备党员') {
                        $(":radio[name='dymzpyjg'][value='不定等次']").attr("checked", "checked");
                        $(":radio[name='dymzpyjg'][value='优秀']").attr("disabled", "disabled");
                        $(":radio[name='dymzpyjg'][value='基本合格']").attr("disabled", "disabled");
                        $(":radio[name='dymzpyjg'][value='不合格']").attr("disabled", "disabled");
                        $(":radio[name='dymzpyjg'][value='合格']").attr("disabled", "disabled");
                    }
                    else {
                        $(":radio[name='dymzpyjg'][value='不定等次']").attr("disabled", "disabled");
                        $(":radio[name='dymzpyjg'][value='优秀']").attr("disabled", "disabled");
                        $(":radio[name='dymzpyjg'][value='基本合格']").attr("disabled", "disabled");
                        $(":radio[name='dymzpyjg'][value='不合格']").attr("disabled", "disabled");
                        $(":radio[name='dymzpyjg'][value='合格']").attr("disabled", "disabled");
                    }

                    break;
                case "合格":
                    $(":radio[name='dymzpyjg']").removeAttr("checked", "checked").removeAttr("disabled");
                    if (zzmm == '中共党员') {
                        $(":radio[name='dymzpyjg'][value='合格']").attr("checked", "checked");
                        $(":radio[name='dymzpyjg'][value='不合格']").attr("disabled", "disabled");
                        $(":radio[name='dymzpyjg'][value='不定等次']").attr("disabled", "disabled");
                        $(":radio[name='dymzpyjg'][value='优秀']").attr("disabled", "disabled");
                    }
                    else if (zzmm == '中共预备党员') {
                        $(":radio[name='dymzpyjg'][value='不定等次']").attr("checked", "checked");
                        $(":radio[name='dymzpyjg'][value='优秀']").attr("disabled", "disabled");
                        $(":radio[name='dymzpyjg'][value='基本合格']").attr("disabled", "disabled");
                        $(":radio[name='dymzpyjg'][value='不合格']").attr("disabled", "disabled");
                        $(":radio[name='dymzpyjg'][value='合格']").attr("disabled", "disabled");
                    }
                    else {
                        $(":radio[name='dymzpyjg'][value='不定等次']").attr("disabled", "disabled");
                        $(":radio[name='dymzpyjg'][value='优秀']").attr("disabled", "disabled");
                        $(":radio[name='dymzpyjg'][value='基本合格']").attr("disabled", "disabled");
                        $(":radio[name='dymzpyjg'][value='不合格']").attr("disabled", "disabled");
                        $(":radio[name='dymzpyjg'][value='合格']").attr("disabled", "disabled");
                    }
                    break;
                case "差":
                    $(":radio[name='dymzpyjg']").removeAttr("checked", "checked").removeAttr("disabled");
                    if (zzmm == '中共党员' || zzmm == '中共预备党员') {
                        $(":radio[name='dymzpyjg'][value='不合格']").attr("checked", "checked");
                        $(":radio[name='dymzpyjg'][value='优秀']").attr("disabled", "disabled");
                        $(":radio[name='dymzpyjg'][value='基本合格']").attr("disabled", "disabled");
                        $(":radio[name='dymzpyjg'][value='合格']").attr("disabled", "disabled");
                        $(":radio[name='dymzpyjg'][value='不定等次']").attr("disabled", "disabled");
                    } else {
                        $(":radio[name='dymzpyjg'][value='不定等次']").attr("disabled", "disabled");
                        $(":radio[name='dymzpyjg'][value='优秀']").attr("disabled", "disabled");
                        $(":radio[name='dymzpyjg'][value='基本合格']").attr("disabled", "disabled");
                        $(":radio[name='dymzpyjg'][value='不合格']").attr("disabled", "disabled");
                        $(":radio[name='dymzpyjg'][value='合格']").attr("disabled", "disabled");
                    }

                    break;
                case "不定结果":
                    $(":radio[name='dymzpyjg']").removeAttr("checked", "checked").removeAttr("disabled");
                    if (zzmm == '中共党员' || zzmm == '中共预备党员') {
                        $(":radio[name='dymzpyjg'][value='不合格']").attr("checked", "checked");
                        $(":radio[name='dymzpyjg'][value='优秀']").attr("disabled", "disabled");
                        $(":radio[name='dymzpyjg'][value='基本合格']").attr("disabled", "disabled");
                        $(":radio[name='dymzpyjg'][value='合格']").attr("disabled", "disabled");
                        $(":radio[name='dymzpyjg'][value='不定等次']").attr("disabled", "disabled");
                    } else {
                        $(":radio[name='dymzpyjg'][value='不定等次']").attr("disabled", "disabled");
                        $(":radio[name='dymzpyjg'][value='优秀']").attr("disabled", "disabled");
                        $(":radio[name='dymzpyjg'][value='基本合格']").attr("disabled", "disabled");
                        $(":radio[name='dymzpyjg'][value='不合格']").attr("disabled", "disabled");
                        $(":radio[name='dymzpyjg'][value='合格']").attr("disabled", "disabled");
                    }
                    break;

            }
            form.render();
        })


        var text = $('#hidzpjg').val();
        // $('#zpjg').find("option:contains(" + text + ")").attr("selected", true);

        $(":radio[name='zpjg'][value=" + text + "]").attr("checked", "checked");
        form.render();
    });

    $("#divtable").height($(window).height() - 100);


    $(function () {

        var error = $("#error").val();
        if (error != "") {
            top.mylayui.msg(error, {icon: 0});
            $("#btnsave").hide();
        }
    })

    function CloseDialog(result, msg) {
         if(result==-1){

             top.mylayui.msg('内部互评分不能为空', {icon: 0});
             $("#btnsave").removeAttr("disabled");

         }else if(result==-2){
             $("#btnsave").removeAttr("disabled");

             top.mylayui.msg('领导评鉴得分不能为空', {icon: 0});

         }else{
             top.frames["iframe"].vUserUATMzpd.addresult(result, msg);

         }
    }
</script>
</body>
</html>